<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增操作工位')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-centralOperationStation-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">操作工位名称：</label>
                <div class="col-sm-8">
                    <input name="name" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">区域：</label>
                <div class="col-sm-8">
                    <select name="areaId" class="form-control m-b" required>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">区域分组：</label>
                <div class="col-sm-8">
                    <select name="groupId" class="form-control m-b" th:with="type=${@dict.getType('area_group')}">
                        <option value="">请选择区域分组</option>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" ></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">加工状态：</label>
                <div class="col-sm-8">
                    <input name="processingStatus" class="form-control input-number" type="text"  required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">权重：</label>
                <div class="col-sm-8">
                    <input name="weight" class="form-control input-number" type="text" >
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">描述：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "central/centralOperationStation"
        $.commonBusiness.getIncrementWeight(prefix)
        $("[name=processingStatus]").inputSpinner();
        $("[name=weight]").inputSpinner();
        $("#form-centralOperationStation-add").validate({
            focusCleanup: true
        });

        $.areaBusiness.getSimpleList({$select:$('[name=areaId]')})

        function submitHandler() {
            if ($.validate.form()) {
                $.operation.insert(prefix, $.common.formToJSON());
            }
        }


    </script>
</body>
</html>